﻿/**
 * 
 * @file FITKFlatPlateFace.h
 * @brief FlatPlateFace 定义
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-11-07
 * 
 */
#ifndef __FITK_ABSTRACT_SEA_FACE___
#define __FITK_ABSTRACT_SEA_FACE___
 

#include "FITK_Kernel/FITKCore/FITKAbstractDataObject.h"
#include "FITKAbstractSEASubSysWithNodes.h"
#include "FITKAbstractSEASubSys.h"

namespace Acoustics
{
    class FITKSEASubSysModelProp;
    class FITKAcousticsAbsNCT;
    class FITKAcousticsTriangles;

     /**
      * @brief 板基础对象FlatPlateFace
      * @author LiBaojun (libaojunqd@foxmail.com)
      * @date 2024-11-07
      */
    class FITKAcousticsModelAPI FITKAbstractSEAFace : 
        public Core::FITKAbstractDataObject
    {
 //       Q_OBJECT
    public:
        /**
         * @brief Construct a new FITKFlatPlateFace object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        explicit FITKAbstractSEAFace();
        /**
         * @brief Destroy the FITKFlatPlateFace object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        virtual ~FITKAbstractSEAFace() = 0;
       /**
        * @brief 获取face类型
        * @return FITKAbstractSEASubSys::SEASubSysType 
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-11-08
        */
        virtual FITKAbstractSEASubSys::SEASubSysType getFaceType() = 0;
        /**
         * @brief    拷贝数据，但不拷贝关联对象列表、模型数据、节点链表和三角形数据
         * @param[i] copyData 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-04
         */
        virtual void copy(FITKAbstractSEAFace* copyData);
        /**
         * @brief    更新模型属性
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-19
         */
        bool updateModelProp();
        /**
         * @brief    获取模型属性
         * @return   FITKSEASubSysModelProp *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-19
         */
        FITKSEASubSysModelProp* getModelPorp();
        /**
         * @brief 设置ID链表
         * @param[i]  nodes            节点列表
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual void setNodes(const QList<FITKAbstractSEASubSysWithNodes::SubSysNode>& nodes);
        /**
         * @brief 获取节点列表
         * @return QList<SubSysNode>
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        QList<FITKAbstractSEASubSysWithNodes::SubSysNode> getNodes();

        /**
         * @brief 获取三角形列表
         * @return FITKAcousticsTriangles*
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        FITKAcousticsTriangles* getTriangleMesh();
        /**
         * @brief 获取节点ID列表
         * @return QList<int>
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        QList<int> getNodeIDs() const;

        /**
        * @brief 是否包含点
        * @param[i] id 节点ID
        * @return bool
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-11-14
        */
        virtual bool isContainsNode(const int id) const;
        /**
         * @brief 添加关联对象， 板、声腔
         * @param[i]  obj            关联对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        void addConnector(FITKAbstractSEASubSys* obj);
        /**
         * @brief 移除关联对象， 板、声腔等，全部移除滞后对象被释放
         * @param[i]  obj            关联对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
          */
        void removeConnector(FITKAbstractSEASubSys* obj);
        /**
         * @brief 获取关联对象， 板、声腔等，若unconnected 返回nullptr
         * @return FITKAbstractSEASubSys*
         * @param[i]  id             关联对象ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        FITKAbstractSEASubSys* getConnectedSubSys(const int & id);
        /**
         * @brief 根据类型获取第一个关联对象， 板、声腔等
         * @return FITKAbstractSEASubSys*
         * @param[i]  t             关联对象类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        FITKAbstractSEASubSys* getAConnectedSubSys(FITKAbstractSEASubSys::SEASubSysType t);
        /**
         * @brief 获取第一个关联的板对象
         * @return FITKAbstractSEASubSys* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-08
         */
        FITKAbstractSEASubSys* getAConnectedShellSubSys();
        /**
         * @brief    设置外部声学包
         * @param[i] id 声学包id
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        void setOutsideNCTID(int id);
        /**
         * @brief    获取外部声学包
         * @return   int 声学包id
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        int getOutsideNCTID();
        /**
         * @brief    获取外部声学包
         * @return   FITKAcousticsAbsNCT *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        FITKAcousticsAbsNCT* getOutsideNCT();
        /**
         * @brief    设置内部声学包
         * @param[i] id 声学包id
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        void setInsideNCTID(int id);
        /**
         * @brief    获取内部声学包
         * @return   int 声学包id
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        int getInsideNCTID();
        /**
         * @brief    获取内部声学包
         * @return   FITKAcousticsAbsNCT *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        FITKAcousticsAbsNCT* getInsideNCT();
        /**
         * @brief    设置外部声学包覆盖率
         * @param[i] percentage
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        void setOutsideNCTCoveredArea(double percentage);
        /**
         * @brief    获取外部声学包覆盖率
         * @return   double
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        double getOutsideNCTCoveredArea();
        /**
         * @brief    设置内部声学包覆盖率
         * @param[i] percentage
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        void setInsideNCTCoveredArea(double percentage);
        /**
         * @brief    获取内部声学包覆盖率
         * @return   double
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        double getInsideNCTCoveredArea();
        /**
         * @brief    FE的面生成face必须调用该接口
         * @param[i] fe true:是使用的FE的面
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-14
         */
        void setFEFace(bool fe);
        /**
         * @brief    该面是否是使用 FE的面生成的
         * @return   bool 
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-14
         */
        bool isFEFace();
        /**
         * @brief    设置几何虚拓扑id
         * @param[i] geoID 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-13
         */
        void setGeometryVirtualTopology(int geoID);
        /**
         * @brief    获取几何虚拓扑id
         * @return   int
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-13
         */
        int getGeometryVirtualTopology();
        /**
         * @brief    检测是否是一个连贯性的板数据与更新边界点
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-13
         */
        bool updatePlateAndBoundaryNode();

     protected:
        /**
        * @brief 节点列表
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-10-06
        */
        QList<FITKAbstractSEASubSysWithNodes::SubSysNode> _nodes{};
        /**
         * @brief 三角形列表
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        FITKAcousticsTriangles* _triMesh{};
        /**
         * @brief  模型属性
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-19
         */
        FITKSEASubSysModelProp* _modelProp{};
        /**
         * @brief 关联对象列表
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        QList<FITKAbstractSEASubSys*> _connector{};
        /**
         * @brief  是否是使用 FE的面生成的
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-14
         */
        bool _isFEFace{ false };
        /**
         * @brief  外部声学包id
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-07
         */
        int _outsideNCTID{ -1 };
        /**
         * @brief  内部声学包id
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-07
         */
        int _insideNCTID{ -1 };
        /**
         * @brief  外部声学包覆盖率 0-100
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-07
         */
        double _outsideNCTCoveredArea{ 100.0 };
        /**
         * @brief  内部声学包覆盖率 0-100
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-07
         */
        double _insideNCTCoveredArea{ 100.0 };
        /**
         * @brief  几何生成的 对应的虚拓扑ID
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-13
         */
        int _geoID{ -1 };
    };
    /**
     * @brief 板基础对象管理器
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-11-07
     */
    class FITKAcousticsModelAPI FITKSEAFaceManager : public Core::FITKAbstractDataObject,
        public Core::FITKAbstractDataManager<FITKAbstractSEAFace>
    {
        FITKCLASS(Acoustics, FITKSEAFaceManager);
    public:
       /**
        * @brief Construct a new FITKFlatPlateFaceManager object
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-11-07
        */
        explicit FITKSEAFaceManager() = default;
        /**
         * @brief Destroy the FITKFlatPlateFaceManager object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        virtual ~FITKSEAFaceManager() = default;
        /**
         * @brief 根据类型创建Face
         * @param[i]  t           类型，只对板类型有效
         * @return FITKAbstractSEAFace* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-07
         */
        static FITKAbstractSEAFace* CreateSEAFace(FITKAbstractSEASubSys::SEASubSysType t);

    protected:
    private:
    };



}


#endif
